﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataAccessLayer;

namespace BusinessLogicLayer
{
    public class LoaiCongBLL
    {
        QuanLyChamCongDataContext DB = new QuanLyChamCongDataContext();

        public List<LOAICONG> LayTatCa()
        {
            return DB.LOAICONGs.ToList();
        }

        public string LayMaLoaiCong(double _socong)
        {
            LOAICONG loaiCong = DB.LOAICONGs.Single(a => a.SoCong == _socong);
            return loaiCong.MaLoaiCong.ToString();
        }

        public Double LaySoCong(String _ma)
        {
            LOAICONG loaiCong = DB.LOAICONGs.Single(a => a.MaLoaiCong == _ma);
            return (Double)loaiCong.SoCong;
        }
    }
}
